﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisionCore
{
    public class PRM_COMInfo
    {
        [Category("通信参数"), DisplayName("IP地址 检测主机"), Description("主机 IP地址"), ReadOnly(true)]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string Insp_IP { get; set; } = "192.168.0.201";

        [Category("通信参数"), DisplayName("IP地址 1#读码器"), Description("1#读码器 IP地址"), ReadOnly(true)]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string CodeReader1_IP { get; set; } = "192.168.0.10";

        [Category("通信参数"), DisplayName("IP地址 1#读码器"), Description("2#读码器 IP地址"), ReadOnly(true)]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string CodeReader2_IP { get; set; } = "192.168.0.11";

        //[Category("通信参数"), DisplayName("IP地址 镭射"), Description("镭射 IP地址"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public string Laser_IP { get; set; } = "192.168.0.60";

        //[Category("通信参数"), DisplayName("IP地址 RTC Server"), Description("RTC 服务器IP地址"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public string RTCServer_IP { get; set; } = "127.0.0.1";

        //[Category("通信参数"), DisplayName("通道A 端口号"), Description("A通道：通道A端口"), DefaultValue(4040), ReadOnly(true)]
        //public int A_Port { get; set; } = 4050;

        //[Category("通信参数"), DisplayName("通道A 本地 [输出] 区块码"), Description("区块码：0xA1,0xA2,0xA3 ....   0xB1,0xB2,0xB3,0xB4... "), DefaultValue(0xA1), ReadOnly(true)]
        //public int A_LocalDB { get; set; } = 0xB1;

        //[Category("通信参数"), DisplayName("通道A 远端 [输入] 区块码"), Description("区块码：0xA1,0xA2,0xA3 ....   0xB1,0xB2,0xB3,0xB4... "), DefaultValue(0xA1), ReadOnly(true)]
        //public int A_RemoteDB { get; set; } = 0xA1;

        //[Category("通信参数"), DisplayName("串口端口名 1.Wheel"), Description("鼻轮控制器串口"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public PortSel WheelPort { get; set; } = PortSel.COM1;

        //[Category("通信参数"), DisplayName("串口端口名 2.检测光源"), Description("检测光源控制器串口"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public PortSel InspLightPort { get; set; } = PortSel.COM15;

        //[Category("通信参数"), DisplayName("串口端口名 3.Aligner"), Description("Aligner控制器串口"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public PortSel AlignerPort { get; set; } = PortSel.COM16;

        //[Category("通信参数"), DisplayName("串口端口名 4.压力计"), Description("倒膜压力计控制器串口"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public PortSel PresureSensorPort { get; set; } = PortSel.COM1;

        //[Category("通信参数"), DisplayName("串口端口名 5.位移传感器"), Description("位移传感器控制器串口"), ReadOnly(true)]
        ////[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        //public PortSel MsSensorPort { get; set; } = PortSel.COM2;

        public override string ToString()
        {
            return "...";
        }
    }

    public enum PortSel
    {
        COM1,
        COM2,
        COM3,
        COM4,
        COM5,
        COM6,
        COM7,
        COM8,
        COM9,
        COM10,
        COM11,
        COM12,
        COM13,
        COM14,
        COM15,
        COM16,
        COM17,
        COM18,
        COM19,
        COM20,
        COM21,
        COM22,
        COM23,
        COM24,
        COM25,
    }
}
